import axios from '@/api/fetch';
import SERVER from '@/api/server';
// 服务顾问 - 下拉框
export const getUserListSelect = params => axios.get(`/api/sysManage/basedata/users/getUserListByRole?role=10071011`, { params });

// 查询所有员工
export const getAllUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);

// 进厂车辆日报
export const getStockAalarmReport = params => axios.get(`${SERVER.DMSCLOUD_PART}/partreport/querystockalarm`, { params });

// 仓库下拉框
export const Storage = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/BasicParametersAfterSales/findAllStroageCode`, { params });

// 备件月报
export const queryPartMonthReport = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_PART}/partreport/queryPartMonthReport`, { params });

// 备件进销存汇总
export const queryPartPeriodSumReport = params => axios.get(`${SERVER.DMSCLOUD_PART}/partreport/queryPartPeriodSumReport`, { params });

// 备件进销存明细
export const queryPartPeriodDetailReport = params => axios.get(`${SERVER.DMSCLOUD_PART}/partreport/queryPartPeriodDetailReport`, { params });

// 备件库存明细查询
export const queryPartStockDetailReport = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_PART}/partreport/queryPartStockDetailReport`, { params });

// DMSCLOUD_PART
export const queryPartPriceReport = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_PART}/partreport/queryPartPriceReport`, { params });

// FIB配件信息查询
export const queryPartFibInfoReport = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_PART}/partreport/queryPartFibInfoReport`, { params });

// 查询备件库存动态详情
export const queryPartStockDetailReportDetailData = params => axios.get(`${SERVER.DMSCLOUD_PART}/partreport/queryPartStockDetailFlowReport`, { params });

// 备件库存动态查询获取备件额外细腻
export const queryPartStockPartData = params => axios.get(`${SERVER.DMSCLOUD_PART}/partreport/partMonthItem`, { params });

// 根据条件获取备件库存动态查询打印数据
export const queryPartInventoryPrintData = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_PART}/partreport/getPartStockPrintInfo`, { params });

// 配件日报
export const queryOrderSelectInfo = params => axios.get(`${SERVER.DMSCLOUD_PART}/report/getDayReport`, { params });

//导出配件日报
export const exportDayReport = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_PART}/report/exportDayReport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};

// 配件月报
export const getMonthReport = params => axios.get(`${SERVER.DMSCLOUD_PART}/report/getMonthReport`, { params });

//导出配件月报
export const exportMonthReport = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_PART}/report/exportMonthReport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};

// 配件年报
export const getYearReport = params => axios.get(`${SERVER.DMSCLOUD_PART}/report/getYearReport`, { params });

//导出配件年报
export const exportYearReport = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_PART}/report/exportYearReport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};

// 配件即时库存报表
export const getStockInfo = params => axios.get(`${SERVER.DMSCLOUD_PART}/report/getStockInfo`, { params });
// 配件即时库存报表总数
export const getStockInfoSum = params => axios.get(`${SERVER.DMSCLOUD_PART}/report/getStockInfoSum`, { params });
// 配件出库报表
export const getOutStockInfo = params => axios.get(`${SERVER.DMSCLOUD_PART}/report/getOutStockInfo`, { params });
// 配件入库报表
export const getInStockInfo = params => axios.get(`${SERVER.DMSCLOUD_PART}/report/getInStockInfo`, { params });

//导出即时库存报表
export const exportStockReport = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_PART}/report/exportStockReport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
//导出出库报表
export const exportOutStockReport = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_PART}/report/exportOutStockReport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
//导出入库报表
export const exportInStockReport = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_PART}/report/exportInStockReport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};

//导出配件月报bj
export const exportMonthReportBJ = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_PART}/pGenPartPeriodTask/exportMonthReportOEM`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
// 预览bj月报表
export const showMonthReport = params => axios.get(`${SERVER.DMSCLOUD_PART}/pGenPartPeriodTask/showMonthReport`, { params });
// 厂端查看bj月报表
export const getMonthReportOEM = params => axios.get(`${SERVER.DMSCLOUD_PART}/pGenPartPeriodTask/getMonthReportOEM`, { params });
// 提交bj月报表
export const uploadMonthReport = params => axios.post(`${SERVER.DMSCLOUD_PART}/pGenPartPeriodTask/uploadMonthReport`, params);
